// index.jsx
import React, { Suspense } from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { Spin } from 'antd';
import store from './store';
import App from './App';

import 'normalize.css';
import 'antd/dist/antd.css'; // antd v4 推荐
import './style/index.scss';

const Loading = (
  <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}>
    <Spin size="large" tip="加载中..." />
  </div>
);

ReactDOM.render(
  <Provider store={store}>
    <BrowserRouter>
      <Suspense fallback={Loading}>
        <App />
      </Suspense>
    </BrowserRouter>
  </Provider>,
  document.getElementById('root')
);
